package com.bee.beemanage.system.common.utils.files;

import java.io.FileReader;
import java.io.IOException;

public class FileUtils {
    public static String fileToString(String path) throws IOException {
        StringBuilder stringBuilder;
        try (FileReader reader = new FileReader(path)) {
            stringBuilder = new StringBuilder();
            char[] buffer = new char[10];
            int size;
            while ((size = reader.read(buffer)) != -1) {
                stringBuilder.append(buffer, 0, size);
            }
        }
        return stringBuilder.toString();
    }
}
